import { createReducer } from '@reduxjs/toolkit';

import {
    changeLoading,
} from './actions';

interface UserState {
    loading: boolean;
}

const initialState: UserState = { 
    loading: false
 }

const counterReducer = createReducer(initialState, (builder) => {
    builder
    .addCase(changeLoading, (state, action) => {
        state.loading = action.payload.loading
    })
})

export default counterReducer